package com.gxa.zhonglong.service.impl;

import com.gxa.zhonglong.mapper.GoodsPushMapper;
import com.gxa.zhonglong.mapper.GoodsPushMapper;
import com.gxa.zhonglong.pojo.GoodsPush;
import com.gxa.zhonglong.service.GoodsPushService;
import com.gxa.zhonglong.service.GoodsPushService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wanjun
 * @version 1.0
 * @date 2021/11/1 15:43
 */
@Transactional(rollbackFor = Throwable.class)
@Service
public class GoodsPushServiceImpl implements GoodsPushService {
    @Autowired
    GoodsPushMapper goodsPushMapper=null;
    @Override
    public void insert(GoodsPush goodsPush) {
        goodsPushMapper.insert(goodsPush);
    }

    @Override
    public void delete(List<Long> listId) {
        for (Long aLong : listId) {
            goodsPushMapper.delete(aLong);
        }
    }

    @Override
    public void update(GoodsPush goodsPush) {
         goodsPushMapper.update(goodsPush);
    }

    @Override
    public List<GoodsPush> selectAll() {
        return goodsPushMapper.selectAll();
    }
}
